<template>
	<view class="app">
		<view class="Album">
			<AppNavbar :bgColor="'#fff'" :title="state.title" titlecolor="#000" leftIconColor="#000" fontWeight="900"
				righticon="more" fixed @rightClick="toDel">
			</AppNavbar>
			<myPhoto :list="state.list" :photoType="state.photoType"></myPhoto>

		</view>
	</view>
</template>

<script setup>
	import {
		getAlbumListApi
	} from '@/api/album.js'

	const state = reactive({
		photoType: 0,
		queryParams: {
			photoType: 1
		},
		list: []
	})
	const getList = async () => {

		const res = await getAlbumListApi(state.queryParams)
		state.list = res.data
		console.log(res);
	}
	const toDel = () => {
		// console.log('eeee');
		uni.navigateTo({
			url: '/pages/FindPet/delAlbum?photoType=' + state.photoType
		})
	}
	onLoad(({
		photoType
	}) => {
		state.photoType = photoType
		state.queryParams.photoType = photoType
		state.title = photoType == 1 ? 'photograph' : photoType == 2 ? 'video' : 'Recently deleted'
		getList()
	})
</script>

<style lang="scss">
	.app {
		.Album {
			height: 100vh;


		}
	}
</style>